<?php TPL::output('global/header.tpl.htm'); ?>

<!--header_e-->
<div class="bd pbd">
 
  <!--left_nav_s-->

  <div class="contant_left readns_discus ps-wd">
  <?php TPL::output('account/setting/menu.tpl.htm'); ?>
	<div id="td-0" style="display:block;">
    <div class="data_s" id="tip_success_message"></div>
	<ul class="ps-xhr">
		<li class="ps-user-face-img"><img id="avatar_src" src="<?php echo get_avatar_url($this->user_id,'max',$this->user_info['avatar_file']); ?>"/></li>
		<li><b>头像设置</b>
			<p class="SH-font">支持 jpg、gif、png 等格式的图片<br/>建议图片尺寸大于 100 × 100 像素</p>
			<span><a href="javascript:;" class="Img-load" id="avatar_uploader" name="button_upload">上传</a></span>			
			<span id="avatar_uploading_status" style="display:none"><img src="<?php echo G_STATIC_URL; ?>/common/load.gif" align="absmiddle"> 文件上传中...</span>
			
		</li>
	</ul>
	

    <form id="setting_form" method="post" action="account/setting/profile_process_ajax/">
	<ul class="ps-info" >
		<li><label>帐号：</label>
			<?php if (!H::isemail($this->user_info['email'])) { ?><input type="text" class="field" name="email" id="email" value="" /> <span id="tip_email" class="all_err_tips hide"></span><?php } else { ?><span class="sFONT"><?php echo $this->user_info['email']; ?></span><?php } ?><?php if ($this->user_info['valid_email'] == 0) { ?> &nbsp; (<a href='javascript:void(0);' onclick="ajax_request(G_BASE_URL + '/account/valid/send_valid_mail/');">您的邮件地址还未验证,请点击进行验证</a>)<?php } ?>
		</li>
		<li><label>真实姓名：</label>
		<?php if ($this->user_info['user_name'] AND $this->user_info['user_name'] != $this->user_info['email']) { ?>
			<span class="sFONT"><?php echo $this->user_info['user_name']; ?></span>
		<?php } else { ?>
			<input type="text" class="add-t2"  name="user_name" id="user_name" style="width:100px;" value="<?php echo $this->user_info['user_name']; ?>" /> <span id="tip_user_name" class="all_err_tips hide"></span>
		<?php } ?>
		</li>
		<li><label>性别：</label><input type="radio" name="sex" id="sex" value="1"<?php if ($this->user_info['sex'] == 1 || empty($this->user_info['sex'])) { ?> checked="checked"<?php } ?>/> 男
		<input type="radio" name="sex" id="sex" value="2" <?php if ($this->user_info['sex'] == 2) { ?> checked="checked"<?php } ?>/> 女
		<input type="radio" name="sex" id="sex" value="3" <?php if ($this->user_info['sex'] == 3) { ?> checked="checked"<?php } ?>/> 保密</li>
		<li><label>生日：</label>
			<select name="birthday_y">
			<?php echo H::display_options($this->birthday_y,$this->birthday_y_s); ?>
			</select> 年
			<select name="birthday_m">
			<?php echo H::display_options($this->birthday_m,$this->birthday_m_s); ?>
			</select> 月
			<select name="birthday_d">
			<?php echo H::display_options($this->birthday_d,$this->birthday_d_s); ?>
			</select> 日
		</li>

		<li><label>现居：</label>
			<select name="province" id="level0" class="select_area"></select>
			<select name="city" id="level1"  class="select_area"></select>
			<select name="district" id="level2"  class="select_area"></select> <span id="tip_level0" class="all_err_tips hide"></span>
		</li>
		<li><label>职业：</label>
        <select name="job_id" class="select_area" >
		<option value="">请选择</option>
        <?php echo H::display_options($this->jobs_list, $this->user_info['job_id']); ?>
		</select>
		</li>
		<li><label>一句话介绍：</label><input name="signature" type="text" id="signature"  class="add-t2" size="40"  value="<?php echo $this->user_info['signature']; ?>"></li>
		
		<li><a href="javascript:;" onclick="$('#signature').focus(); ajax_post($('#setting_form'), _tips_form_processer); return false;" class="seve_s">保存</a></li>
	</ul>
    </form>
	</div>
	
	</div>

	<!--微博绑定_e-->
    </div>
  <!--left_nav_e-->
</div>

<script type="text/javascript">
$(document).ready(function () {
    $(".select_area").LocationSelect({
        labels: ["请选择省份或直辖市", "请选择城市", "请选择区"],
        
        elements: document.getElementsByTagName("select"),
        
        detector: function () {
            this.selectID(["<?php echo $this->user_info['province']; ?>", "<?php echo $this->user_info['city']; ?>", "<?php echo $this->user_info['district']; ?>"]);
        },	// 默认显示的城市
        
		dataUrl: "<?php echo G_STATIC_URL; ?>/js/areas.js"
    });
    
    init_avatar_uploader($('#avatar_uploader'), $('#avatar_uploading_status'), $("#avatar_src"));
});
</script>

<?php TPL::output('global/footer.tpl.htm'); ?>